package com.example.manager.web;

import com.example.common.Ov.QuotaApplicationOv;
import com.example.common.entity.PageParam;
import com.example.common.entity.Rsp;
import com.example.common.pojo.QuotaApplication;
import com.example.manager.service.QuotaApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("QuotaApplication")
public class QuotaApplicationController {

    @Autowired
    private QuotaApplicationService quotaApplicationService;

    @PostMapping("getList")
    public Rsp getAllQuotaApp(@RequestBody PageParam<QuotaApplicationOv> pageParam) {
        return quotaApplicationService.getQuotaList(pageParam);

    }
  //借款审核通过
    @PostMapping("approved")
    public Rsp approved(@RequestBody QuotaApplication quotaApplication){

        return quotaApplicationService.updateStatus(quotaApplication);
    }
//借款审核驳回
    @PostMapping("approvedBack")
    public Rsp approvedBack(@RequestBody QuotaApplication quotaApplication){

        return quotaApplicationService.updateStatusBack(quotaApplication);
    }
}
